{template 'common/header-base'}
<style>
	.nav.nav-tabs{border-color:#44b549;}
	.nav-tabs>li>a:hover{border-color:#eee #eee #44b549 #eee;}
	.nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, .nav-tabs>li.active>a:focus{background-color:#44b549; border-color:#44b549;}
	.nav-tabs>li>a {border-radius: 0 0 0 0;}
	.nav{background-color: white;}
	.nav-tabs > li.active > a, .nav-tabs > li.active > a:hover, .nav-tabs > li.active > a:focus {
		color: #FFF;
		background-color: #449d44;
		border-color: #449d44;}
	.list-group .list-group-item.active {
		background-color: #449d44;
		border-color: #449d44;
	}
	.navbar-inverse {
		background-color: #fff;
		border-color: #449d44
	}
	.block {
		display: block;
	}

	.clear {
		display: block;
		overflow: hidden;
	}
	.navbar-nav > li > a {
		padding-top: 10px;
		padding-bottom: 10px;
		line-height: 40px
	}
	.navbar-inverse .navbar-nav>li>a:hover, .navbar-inverse .navbar-nav>li>a:focus{
		color: #777;
		background-color: #eee;
	}
	.big-menu .panel .panel-heading .panel-title,.big-menu .panel .list-group-item{overflow:hidden; white-space:normal; text-overflow:clip;}
</style>
<div class="navbar navbar-inverse navbar-static-top" role="navigation" style="position:static;">
	<div class="col-xs-12 col-sm-3 col-lg-2">
		<div style="height: 60px;background: transparent url({RES}images/logo.png) center no-repeat;background-color:white;background-size: 100% auto;"></div>
	</div>
	<div class="container-fluid">
		{if defined('IN_SOLUTION')}
		<ul class="nav navbar-nav">
			{php global $solution,$solutions;}
			{if $_W['role'] != 'operator'}
			<li><a href="{url 'home/welcome/ext'}"><i class="fa fa-reply-all"></i>返回公众号功能管理</a></li>
			{/if}
			{loop $solutions $row}
			<li{if $row['name'] == $solution['name']} class="active"{/if}><a href="{url 'home/welcome/solution' array('m' => $row['name'])}"><i class="fa fa-cog"></i>{$row['title']}</a></li>
			{/loop}
		</ul>
		{else}
		<ul class="nav navbar-nav">
			<li><a href="index.php?c=home&a=welcome&do=platform&"><i class="fa fa-reply-all"></i>返回系统</a></li>
			<li><a href="{php echo $this->createWebUrl('stores', array('op' => 'display'))}"><i class="fa fa-refresh"></i>切换门店</a></li>
			{if !empty($_W['isfounder']) || empty($_W['setting']['permurls']['sections']) || in_array('mc', $_W['setting']['permurls']['sections'])}<li{if FRAME == 'mc'} class="active"{/if}><a href="{url 'home/welcome/mc'}"><i class="fa fa-gift"></i>粉丝营销</a></li>{/if}
			{if !empty($_W['isfounder']) || empty($_W['setting']['permurls']['sections']) || in_array('ext', $_W['setting']['permurls']['sections'])}<li><a href="{url 'home/welcome/ext'}"><i class="fa fa-cubes"></i>扩展功能</a></li>{/if}
		</ul>
		{/if}
		<ul class="nav navbar-nav navbar-right">
			<li class="dropdown">
				<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" style="display:block; max-width:200px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-group"></i>{$_W['account']['name']} <b class="caret"></b></a>
				<ul class="dropdown-menu">
					{if $_W['role'] != 'operator'}
					<li><a href="{url 'account/post' array('uniacid' => $_W['uniacid'])}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 编辑当前账号资料</a></li>
					{/if}
					<li><a href="{url 'account/display'}" target="_blank"><i class="fa fa-cogs fa-fw"></i> 管理其它公众号</a></li>
					<li><a href="{url 'utility/emulator'}" target="_blank"><i class="fa fa-mobile fa-fw"></i> 模拟测试</a></li>
				</ul>
			</li>
			<li class="dropdown">
				<a href="javascript:;" class="dropdown-toggle" data-toggle="dropdown" style="display:block; max-width:185px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; "><i class="fa fa-user"></i>{$_W['user']['username']} ({if $_W['role'] == 'founder'}系统管理员{elseif $_W['role'] == 'manager'}公众号管理员{else}公众号操作员{/if}) <b class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a href="{url 'user/profile/profile'}" target="_blank"><i class="fa fa-weixin fa-fw"></i> 我的账号</a></li>
					{if $_W['role'] != 'operator'}
					<li class="divider"></li>
					<li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-sitemap fa-fw"></i> 系统选项</a></li>
					<li><a href="{url 'system/welcome'}" target="_blank"><i class="fa fa-cloud-download fa-fw"></i> 自动更新</a></li>
					<li><a href="{url 'system/updatecache'}" target="_blank"><i class="fa fa-refresh fa-fw"></i> 更新缓存</a></li>
					<li class="divider"></li>
					{/if}
					<li><a href="{url 'user/logout'}"><i class="fa fa-sign-out fa-fw"></i> 退出系统</a></li>
				</ul>
			</li>
		</ul>
	</div>
</div>

<div class="container-fluid">
	{if defined('IN_MESSAGE')}
	<div class="jumbotron clearfix alert alert-{$label}">
		<div class="row">
			<div class="col-xs-12 col-sm-3 col-lg-2">
				<i class="fa fa-5x fa-{if $label=='success'}check-circle{/if}{if $label=='danger'}times-circle{/if}{if $label=='info'}info-circle{/if}{if $label=='warning'}exclamation-triangle{/if}"></i>
			</div>
			<div class="col-xs-12 col-sm-8 col-md-9 col-lg-10">
				{if is_array($msg)}
				<h2>MYSQL 错误：</h2>
				<p>{php echo cutstr($msg['sql'], 300, 1);}</p>
				<p><b>{$msg['error'][0]} {$msg['error'][1]}：</b>{$msg['error'][2]}</p>
				{else}
				<h2>{$caption}</h2>
				<p>{$msg}</p>
				{/if}
				{if $redirect}
				<p><a href="{$redirect}">如果你的浏览器没有自动跳转，请点击此链接</a></p>
				<script type="text/javascript">
					setTimeout(function () {
						location.href = "{$redirect}";
					}, 3000);
				</script>
				{else}
				<p>[<a href="javascript:history.go(-1);">点击这里返回上一页</a>] &nbsp; [<a href="./?refresh">首页</a>]</p>
				{/if}
			</div>
			{else}
			<div class="row">
				{php $frames = empty($frames) ? $GLOBALS['frames'] : $frames; _calc_current_frames($frames);}
				{if !empty($frames)}
				<div class="col-xs-12 col-sm-3 col-lg-2 big-menu">
					{if $cur_store}
					<div class="panel panel-default" style="padding-bottom: 10px;">
						<span style="width:13.3333337%; height:100px;display: table-cell; line-height:100px; vertical-align:middle;text-align: center;">
							<img style="width:100px;margin-top:10px;border-radius:50%;" alt="image" class="img-circle" src="{php echo tomedia($cur_store['logo'])}" />
						</span>
						<a data-toggle="dropdown" class="dropdown-toggle" href="#" >
							<span>
							<span style="text-align:center;" class="block m-t-xs"><strong class="font-bold">{$cur_store['title']}</strong></span>
							<span style="text-align:center;" class="text-muted text-xs block"><strong class="font-bold">{$_W['user']['username']}</strong>({if $_W['role'] == 'founder'}系统管理员{elseif $_W['role'] == 'manager'}公众号管理员{else}门店管理员{/if})</span>
							</span>
						</a>
					</div>
					{/if}
					{loop $frames $k $frame}
					<div class="panel panel-default">
						<div class="panel-heading">
							<h4 class="panel-title">{$frame['title']}</h4>
							<a class="panel-collapse collapsed" data-toggle="collapse" href="#frame-{$k}">
								<i class="fa fa-chevron-circle-down"></i>
							</a>
						</div>
						<ul class="list-group collapse in" id="frame-{$k}">
							{loop $frame['items'] $link}
							{if !empty($link['append'])}
							<li class="list-group-item{$link['active']}" onclick="window.location.href = '{$link['url']}';" style="cursor:pointer;" kw="{$link['title']}">
								{$link['title']}
								<a class="pull-right" href="{$link['append']['url']}">{$link['append']['title']}</a>
							</li>
							{else}
							<a class="list-group-item{$link['active']}" href="{$link['url']}" kw="{$link['title']}" style="padding-left: 40px;">{$link['title']}</a>
							{/if}
							{/loop}
						</ul>
					</div>
					{/loop}
					<script type="text/javascript">
						require(['bootstrap'], function(){
							$('#search-menu input').keyup(function() {
								var a = $(this).val();
								$('.big-menu .list-group-item, .big-menu .panel-heading').hide();
								$('.big-menu .list-group-item').each(function() {
									$(this).css('border-left', '0');
									if(a.length > 0 && $(this).attr('kw').indexOf(a) >= 0) {
										$(this).parents(".panel").find('.panel-heading').show();
										$(this).show().css('border-left', '3px #428bca double');
									}
								});
								if(a.length == 0) {
									$('.big-menu .list-group-item, .big-menu .panel-heading').show();
								}
							});
						});
					</script>
				</div>
				<div class="col-xs-12 col-sm-9 col-lg-10">
					<style>.topNav{border-bottom-color: rgb(0, 0, 0);border-bottom-width: 0.1em;border-bottom-style: inset;}</style>
					{if CRUMBS_NAV == 1}
					{php global $module_types;global $module;global $ptr_title;}
					{php $frames = empty($frames) ? $GLOBALS['frames'] : $frames; _calc_current_frames($frames);}
					<script language='javascript'>
						$(function(){
							$(".breadcrumb").remove();
						})
					</script>

					<ol class="breadcrumb" style="padding:5px 0;">
						<li><a href="{url 'home/welcome/ext'}"><i class="fa fa-cogs"></i> &nbsp; 扩展功能</a></li>
						<li><a href="{url 'home/welcome/ext' array('m' => $module['name'])}">{$module_types[$module['type']]['title']}模块 - {$module['title']}</a></li>
						<li class="active">{$ptr_title}</li>
					</ol>
					{elseif CRUMBS_NAV == 2}
					{php global $module_types;global $module;global $ptr_title; global $site_urls; $m = $_GPC['m'];}
					<ul class="nav nav-tabs">
						<li><a href="{url 'platform/reply' array('m' => $m)}">管理{$module['title']}</a></li>
						<li><a href="{url 'platform/reply/post' array('m' => $m)}"><i class="fa fa-plus"></i> 添加{$module['title']}</a></li>
						{if !empty($site_urls)}
						{loop $site_urls $site_url}
						<li {if $_GPC['do'] == $site_url['do']} class="active"{/if}><a href="{$site_url['url']}"> {$site_url['title']}</a></li>
						{/loop}
						{/if}
					</ul>
					{/if}
					{else}
					<div>
						{/if}
						{/if}
